<template>
  <el-menu
    :default-active="defaultIndex"
    class="el-menu-title-1"
    mode="horizontal"
    @select="handleSelect"
    router
  >
    <el-menu-item :key="item.url" v-for="item in menu1" :index="item.url"
      ><div class="title-menu">
        <img src="./menuselect.png" v-if="defaultIndex == item.url" />
        <img src="./menubg.png" v-if="defaultIndex != item.url" />
        <div class="title-menu-name">{{ item.title }}</div>
      </div></el-menu-item
    >
  </el-menu>
</template>

<script>
const menu1 = [
  {
    title: "政务服务",
    url: "/big-screen-1",
  },
  {
    title: "服务效能",
    url: "/big-screen-2",
  },
  {
    title: "应急调度",
    url: "/big-screen-3",
  },
  {
    title: "经济发展",
    url: "/big-screen-4",
  },
];
export default {
  data() {
    return {
      menu1,
      defaultIndex: this.$route.path || "",
    };
  },
  
};
</script>

<style>
.el-menu-title-1 {
  border-bottom: none !important;
  display: flex;
  left: 15%;
  z-index: 200;
  position: fixed;
  top: 5%;
  width: 45%;
  background: none;
}
.title-menu {
  position: relative;
}
.title-menu-name {
  font-size: 3.5rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(0deg, #a3dafe 0%, #ffffff 100%);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
</style>